package com.wtwd.device.constant;

/**
 * @author zdl
 * @date 2021/11/24 10:11
 */
public enum AppMsgEnum {

    EXCP_LOGIN("101", "异地登陆", "您的账号,已在其他设备登陆", "{extraParams:{code:'101'}}"),
    ADD_FRIEND("201","亲友空间","申请添加好友","{extraParams:{code:'201'}}"),
    REFUSED_FRIEND("202","亲友空间","{0}拒绝了您的好友申请","{extraParams:{code:'202'}}"),
    DELETE_FRIEND("203","亲友空间","{0}取消了对您的关注","{extraParams:{code:'203'}}");
    private String code;
    private String title;
    private String contents;
    private String extraParams;

    private static final String TITLE_KEY = "title";
    private static final String MSG_KEY = "contents";

    AppMsgEnum(String code, String title, String contents, String extra) {
        this.code = code;
        this.title = title;
        this.contents = contents;
        this.extraParams = extra;
    }

    public String getCode() {
        return code;
    }

    public String getTitle() {
        return title;
    }

    public String getContents() {
        return contents;
    }

    public String getExtraParams() {
        return extraParams;
    }

    public String getTitleKey() {
        return this.name().toLowerCase() + SeparatorConstant.DOT + TITLE_KEY;
    }

    public String getContentsKey() {
        return this.name().toLowerCase() + SeparatorConstant.DOT + MSG_KEY;
    }
}
